package com.manjason.property.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "t_property")
public class Property {
    private int id;
    private String playerName;// 玩家名字
    private Integer physical; //力量
    private Integer quick; //敏捷
    private Integer luck; //幸运
    private Integer physique; //体质
    private Integer iq; //智力
    private Integer spirit; //精神

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "player_name")
    public String getPlayerName() {
        return playerName;
    }

    public void setPlayerName(String playerName) {
        this.playerName = playerName;
    }

    @Basic
    @Column(name = "physical")
    public Integer getPhysical() {
        return physical;
    }

    public void setPhysical(Integer physical) {
        this.physical = physical;
    }

    @Basic
    @Column(name = "quick")
    public Integer getQuick() {
        return quick;
    }

    public void setQuick(Integer quick) {
        this.quick = quick;
    }

    @Basic
    @Column(name = "luck")
    public Integer getLuck() {
        return luck;
    }

    public void setLuck(Integer luck) {
        this.luck = luck;
    }

    @Basic
    @Column(name = "physique")
    public Integer getPhysique() {
        return physique;
    }

    public void setPhysique(Integer physique) {
        this.physique = physique;
    }

    @Basic
    @Column(name = "iq")
    public Integer getIq() {
        return iq;
    }

    public void setIq(Integer iq) {
        this.iq = iq;
    }

    @Basic
    @Column(name = "spirit")
    public Integer getSpirit() {
        return spirit;
    }

    public void setSpirit(Integer spirit) {
        this.spirit = spirit;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Property that = (Property) o;
        return id == that.id &&
                Objects.equals(playerName, that.playerName) &&
                Objects.equals(physical, that.physical) &&
                Objects.equals(quick, that.quick) &&
                Objects.equals(luck, that.luck) &&
                Objects.equals(physique, that.physique) &&
                Objects.equals(iq, that.iq) &&
                Objects.equals(spirit, that.spirit);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, playerName, physical, quick, luck, physique, iq, spirit);
    }
}
